﻿<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="Manhua2.Pages.DownloadPage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Manhua2.Pages"
    xmlns:common="using:Manhua2.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Style="{StaticResource LayoutRootStyle}">
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="90" />
        </Grid.RowDefinitions>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
            <TextBlock x:Name="pageTitle" Grid.Column="1" Text="正在下载" Style="{StaticResource PageHeaderTextStyle}"/>
            <WebView Grid.Column="1" Margin="300,10,0,0" 
                             HorizontalAlignment="Left" 
                             VerticalAlignment="Top" 
                             Width="900" Height="120" Source="http://wowhy.sinaapp.com/metro.php"/>
        </Grid>
        <GridView x:Name="gvDownloads"
                  ItemsSource="{Binding Download}"
                  ItemTemplate="{StaticResource DownloadItemTemplate}"
                  SelectionMode="Multiple" Grid.Row="1">
        </GridView>
        <StackPanel  Orientation="Horizontal" Grid.Row="2" Background="{StaticResource AppBarBackgroundThemeBrush}">
            <Button x:Name="btnSelectAll" Style="{StaticResource SelectAllAppBarButtonStyle}" Tag="全选" AutomationProperties.Name="{Binding Tag, RelativeSource={RelativeSource Self}}" Click="btnSelectAll_Click" />
            <Button x:Name="btnPause" Style="{StaticResource PauseAppBarButtonStyle}" AutomationProperties.Name="暂停下载" Click="btnPause_Click" />
            <Button x:Name="btnResume" Style="{StaticResource PlayAppBarButtonStyle}" AutomationProperties.Name="恢复下载" Click="btnResume_Click" />
            <Button x:Name="btnDelete" Style="{StaticResource DeleteAppBarButtonStyle}" AutomationProperties.Name="取消下载" Click="btnDelete_Click" />
        </StackPanel>
    </Grid>
</common:LayoutAwarePage>
